<html>
  <head>
    <meta charset="utf-8"/>
    <script src="wasm_exec.js"></script>
    <script>
      const go = new Go();
      WebAssembly.instantiateStreaming(fetch("tvix.wasm"), go.importObject).then((result) => {
	  go.run(result.instance);
      });
    </script>
    <style>
      body {
          background: #008080;
      }
    </style>
    <!-- deps -->
    <link rel="stylesheet" href="https://unpkg.com/98.css">
  </head>
  <body>
    <div class="window" style="margin: 32px; width: 700px">
      <div class="title-bar">
        <div class="title-bar-text">
          Tvix Bolt
        </div>

        <div class="title-bar-controls">
          <a href="https://tvix.dev"><button aria-label="Help"></button></a>
          <button aria-label="Close"></button>
        </div>
      </div>
      <div class="window-body" style="display: flex;">
        <div id="input-section" style="width: 40%; padding-right: 14px;">
          <p>This program lets you explore the Tvix language evaluator
            for the Nix language.</p>
          <p>Tvix is a project by <a href="https://tvl.fyi">TVL</a>.
            <div class="field-row-stacked" >
              <label for="nix-code">Enter some Nix code:</label>
              <textarea id="nix-code" rows="8" spellcheck="false"
                        oninput="processNixInput()"></textarea>
            </div>
            <section class="field-row" style="justify-content: flex-end">
              <button onclick="resetCode()">Reset</button>
            </section>
        </div>
        <div id="output-section" style="width: 60%;">
          <menu role="tablist" >
            <li role="tab" aria-selected="true"><a href="#tabs">Output</a></li>
            <li role="tab"><a href="#tabs">Bytecode</a></li>
            <li role="tab"><a href="#tabs">Runtime trace</a></li>
            <li role="tab"><a href="#tabs">Parsed AST</a></li>
          </menu>
          <div class="window" role="tabpanel">
            <div class="window-body" style="height: 76%;">
              <p id="output-value">Enter some Nix code to get started!</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
